package cn.jw.starter.common.scheduletask.model;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

/**
 * @author wgs
 */
@Getter
@Slf4j
public class TaskProxyRunnable implements Runnable {
    private final Runnable runnable;

    public TaskProxyRunnable(Runnable runnable) {
        this.runnable = runnable;
    }

    @Override
    public void run() {
        try {
            runnable.run();
        } catch (Throwable e) {
            log.error("定时任务执行异常, taskRunnable = {}", runnable.getClass().getName(), e);
        }
    }

}
